{% extends "base.html" %}

{% block title %}Edit Post{% endblock %}

{% block content %}
    <h2>Edit Post</h2>
    <form method="post">
        {{ form.hidden_tag() }}
        <div class="form-group">
            {{ form.title.label }}
            {{ form.title(class_='form-control', value=post.title) }}
        </div>
        <div class="form-group">
            {{ form.body.label }}
            {{ form.body(class_='form-control', value=post.body) }}
        </div>
        <div class="form-group">
            {{ form.submit(class_='btn btn-primary') }}
        </div>
    </form>
    <a href="{{ url_for('delete_post', post_id=post.id) }}" class="btn btn-danger">Delete Post</a>
{% endblock %}
